<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <h:form>

            <p:panel id="panelPrint"  styleClass="noBorder summeryBorder" header="Collecting Centre Sale Report">
                <f:facet name="header"  >
                    <p:outputLabel value="Lab Credit Sale Report By Investigation" styleClass="noPrintButton"/>
                    <p:commandButton value="Refresh" ajax="false"  styleClass="noPrintButton" style="float: right;" />

                    <p:commandButton ajax="false" value="Print"  styleClass="noPrintButton" style="float: right;" >
                        <p:printer target="panelPrint" />
                    </p:commandButton>
                    <p:commandButton ajax="false" value="Excel"  styleClass="noPrintButton" style="float: right;" >
                        <p:dataExporter type="xls" target="tbl"  fileName="Collecting_Centre_Sale_Report" />
                    </p:commandButton>  

                    <p:panelGrid columns="5" style="min-width: 100%;" styleClass="noPrintButton">
                        <h:outputLabel value="From Date"/>
                        <p:calendar id="frmDate" value="#{investigationMonthSummeryOwnController.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel value="To Date"/>
                        <p:calendar id="toDate" value="#{investigationMonthSummeryOwnController.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>

                        <p:autoComplete forceSelection="true" value="#{investigationMonthSummeryOwnController.creditCompany}" completeMethod="#{collectingCentreController.completeCollecting}" var="ix" itemLabel="#{ix.name}" itemValue="#{ix}" size="30"  style="width: 400px;">
                            <p:column>
                                #{ix.name}
                            </p:column>
                            <p:column>
                                #{ix.institutionCode}
                            </p:column>
                        </p:autoComplete>

                    </p:panelGrid>
                </f:facet>
                <br/><br/>
                
                <p:dataTable id="tbl" value="#{investigationMonthSummeryOwnController.items3}" var="c" >

                    <f:facet name="header">

                        <h:outputLabel value="Investigation Month End Summary By "/>
                        <h:outputLabel value="#{investigationMonthSummeryOwnController.creditCompany.name} "/>
                        <br/>
                        <h:outputLabel value="#{investigationMonthSummeryOwnController.fromDate} ">
                            <f:convertDateTime pattern="dd MMMM yyyy" />
                        </h:outputLabel>

                        <h:outputLabel value="#{investigationMonthSummeryOwnController.toDate} ">
                            <f:convertDateTime pattern="dd MMMM yyyy" />
                        </h:outputLabel>

                    </f:facet>

                    <p:column headerText="Test Name" >
                        <h:outputLabel value="#{c.investigation.name}"  />
                    </p:column>
                    <p:column headerText="Count" >
                        <h:outputLabel value="#{c.count}" />
                    </p:column>
                    <p:columnGroup type="footer">  
                        <p:row>                              
                            <p:column footerText="Total" colspan="1"/>
                            <p:column footerText="#{investigationMonthSummeryOwnController.countTotal2}" >
                                <f:facet name="footer">
                                    <h:outputLabel value="#{investigationMonthSummeryOwnController.countTotal2}">

                                    </h:outputLabel>
                                </f:facet>
                            </p:column>                             
                        </p:row>  
                    </p:columnGroup> 

                </p:dataTable>
            </p:panel>   

        </h:form>

    </ui:define>

</ui:composition>
